import request from '@/config/axios'

// 发酵罐 VO
export interface FermentorVO {
  id: number // id
  deviceId: string // 设备编号
  name: string // 设备名称
  description: string // 描述
  status: number // 状态
}

// 发酵罐 API
export const FermentorApi = {
  // 查询发酵罐分页
  getFermentorPage: async (params: any) => {
    return await request.get({ url: `/farm/fermentor/page`, params })
  },

  // 查询发酵罐详情
  getFermentor: async (id: number) => {
    return await request.get({ url: `/farm/fermentor/get?id=` + id })
  },

  // 新增发酵罐
  createFermentor: async (data: FermentorVO) => {
    return await request.post({ url: `/farm/fermentor/create`, data })
  },

  // 修改发酵罐
  updateFermentor: async (data: FermentorVO) => {
    return await request.put({ url: `/farm/fermentor/update`, data })
  },

  // 删除发酵罐
  deleteFermentor: async (id: number) => {
    return await request.delete({ url: `/farm/fermentor/delete?id=` + id })
  },

  // 导出发酵罐 Excel
  exportFermentor: async (params) => {
    return await request.download({ url: `/farm/fermentor/export-excel`, params })
  },
}